using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class privilegeMap : EntityTypeConfiguration<privilege>
    {
        public privilegeMap()
        {
            // Primary Key
            this.HasKey(t => t.privilege_id);

            // Properties
            this.Property(t => t.privilege_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.privilege_name)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.privilege_desc)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("privilege");
            this.Property(t => t.privilege_id).HasColumnName("privilege_id");
            this.Property(t => t.privilege_name).HasColumnName("privilege_name");
            this.Property(t => t.privilege_desc).HasColumnName("privilege_desc");
            this.Property(t => t.privilege_available).HasColumnName("privilege_available");
        }
    }
}
